import array



class ArrayDeque:
	increment = 1500
	padding = array.array('b', '\x00' * increment)
	
	def __init__(self):
		self.array = array.array('b')
		self.begin = 0
		self.end = 0
		self.size = 0
		self.capacity = len(self.array)
	
	def enque(self, data):
		dataSize = len(data)
		vacantSize = self.capacity - self.size
		needSize = dataSize - vacantSize
		
		if needSize > 0:
			loop = needSize // increment + 1
			for i in xrange(loop):
				self.array[self.end : self.end] = padding
			self.capacity = len(self.array)
			